package com.mingke.chat.message.request;

import com.mingke.chat.message.logic.EasyChatGroupRequestLogic;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.nio.channels.AsynchronousSocketChannel;

/**
 * @author mingke
 * @function 群聊请求
 * @date 2022/1/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EasyChatGroupRequest extends EasyChatRequest {
    /** 消息的发送者*/
    private Integer fromNumber;
    /** 消息要发往的群聊*/
    private Integer groupID;
    /** 消息的内容*/
    private String content;

    @Override
    public String toString() {
        return "EasyChatGroupRequest{" +
                "fromNumber=" + fromNumber +
                ", groupID=" + groupID +
                ", content='" + content + '\'' +
                '}';
    }

    @Override
    public void handlerMessage(AsynchronousSocketChannel socketChannel) {
        EasyChatGroupRequestLogic logic = new EasyChatGroupRequestLogic();
        logic.doLogic(this);
    }
}
